package com.loan.service;
import java.util.Arrays;
import java.util.Map;

import com.jfinal.plugin.activerecord.Page;
import com.loan.model.Role;

public class RoleService extends BaseService<Role>{  
	
	/**
	 * 获取个人信息
	 * @throws Exception 
	 */
	public Role getInfo(int cid, String code) {
		return Role.dao.findFirst("select * from role where cid=? and code=?",cid,code);
	}
	
	/** 
	 * 分页数据
	 */
	public Page<Role> list(int page, int size, Map<String, String> map) {
		return Role.dao.paginate(page, size, buildSql("role",Arrays.asList("cid", "code", "name"),map," order by create_time asc "));
	}
}